<% if logged_in? %>
<% if current_user.admin? %>
<%= link_to "发表", newpost_path ,class: "btn hnod" %>
<% end %>
<%= link_to "主页", root_path ,class: "btn hnod" %>
<%= link_to "登出", logout_path, method: :delete ,class: "btn hnod"%>
<%= link_to "设置", edit_user_path(current_user) ,class: "btn hnod"%>
<% else %>
<%= link_to "主页", root_path ,class: "btn hnod" %>
<%= link_to "注册", signup_path ,class: "btn hnod" %>
<%= link_to "登录", login_path ,class: "btn hnod" %>
<% end %>